@extends('admin.layout.app')
@section('title', '项目申请列表')

@section('nav')
    @include('admin.layout.nav', ['title'=> ['项目申请管理','项目申请列表']])
@endsection

@section('content')
    <div class="box box-primary" style="min-height: 300px;">
        <div class="box-header with-border">
            <h3 class="box-title">项目申请列表</h3>
        </div>
        <!-- /.box-header -->
        <div class="box-body">
            <form class="form-inline" style="margin-bottom: 15px;" autocomplete="off">
                <div class="form-group">
                    <label for="name">模糊查询</label>
                    <input type="text" class="form-control" value="{{isset($query['name'])?$query['name']:''}}" name="name" placeholder="名称/申请人">
                </div>
                <div class="form-group">
                    <label for="status">审核状态</label>
                    <select class="form-control" name="status">
                        <option value="-1"></option>
                        <option value="0" @if(isset($query['status'])&&$query['status']==0) selected @endif>待审核</option>
                        <option value="1" @if(isset($query['status'])&&$query['status']==1) selected @endif>已通过</option>
                        <option value="2" @if(isset($query['status'])&&$query['status']==2) selected @endif>未通过</option>
                    </select>
                </div>
                <button type="submit" class="btn btn-default">查询</button>
                <a type="button" href="/project/apply" class="btn btn-success">申请项目</a>
            </form>
            <table class="table table-bordered table-hover">
                <thead>
                <tr class="active">
                    <th width="50px">序号</th>
                    <th min-width="100px">项目名称</th>
                    <th min-width="100px">申请理由</th>
                    <th width="100px">项目申请人</th>
                    <th width="100px">项目甲方</th>
                    <th width="100px">项目金额</th>
                    <th width="80px">审核状态</th>
                    <th width="150px">申请时间</th>
                    <th style="width: 80px">操作</th>
                </tr>
                </thead>
                <tbody>
                @forelse($list as $item)
                <tr>
                    <td>{{$loop->index+1+($list->currentPage()-1)*$list->perPage()}}</td>
                    <td>{{$item->name}}</td>
                    <td>{{$item->reason}}</td>
                    <td>{{$item->user_name}}</td>
                    <td>{{$item->first_party}}</td>
                    <td>{{$item->money}}</td>
                    <td><span class="badge bg-{{$item->status==0?'yellow':($item->status==1?'green':'red')}}">{{$item->status==0?'待审核':($item->status==1?'通过':'未通过')}}</span></td>
                    <td>{{$item->created_at}}</td>
                    <td></td>
                </tr>
                @empty
                <tr>
                    <td colspan="8" align="center">暂无数据</td>
                </tr>
                @endforelse
                </tbody>
            </table>
        </div>
        <!-- /.box-body -->
        <div class="box-footer clearfix">
            <div class="pull-right">
                {{ $list->links() }}
            </div>
        </div>
    </div>
@endsection

@section('style')
    <style>

    </style>
@endsection

@section('js')

@endsection